package com.changgou;

import com.changgou.util.IdWorker;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

/**
 * @author ：周
 * @ClassName: CommentApplication
 * @date ：2019/8/15  14:35
 * @description ：
 * @version: 1.0
 */
@SpringBootApplication
@EnableEurekaClient
@EnableFeignClients(basePackages = {"com.changgou"})
public class CommentApplication {
    public static void main(String[] args) {
        SpringApplication.run(CommentApplication.class , args);
    }

    @Value( "${workerId}" )
    private Integer workerId;

    @Value( "${datacenterId}" )
    private Integer datacenterId;


    @Bean
    public IdWorker idWorker(){
        return new IdWorker( workerId,datacenterId);
    }

}
